{include file=member.header.html}
<style type="text/css">
.clearfix:after{ content:'\20'; display:block; height:0; overflow:hidden; clear:both}
.float_right {float: right;}
.refund_info{border:1px #ddd solid;padding:10px; line-height:24px;border-bottom:0;}
.refund_btn{border:1px #ddd solid;border-top:0;border-bottom:0;padding:10px;}
ul{ line-height:none}
.refund_form input{ vertical-align:middle}
.refund_message{ background:#FFF7EB;padding:20px;border:1px #ddd solid;width:926px;}
.message_form{margin-bottom:10px; height:100px; }
.messge_list{border:1px #ddd solid;}
.message_list .title{border:1px #ddd solid; line-height:30px; height:30px; background:#fff;}
.message_list .title h3{float:left;width:300px;font-size:12px;padding-left:5px;}
.message_list .title span{float:right;padding-right:5px;}
.message_list .content{ background:#fff;padding:10px;border:1px #ddd solid;border-top:0;width:904px;border-bottom:0;}
.refund_btn a,.refund_message_btn{ display:inline-block; background:url('{res file=images/refund_btn.jpg}') no-repeat; width:83px; height:30px; line-height:30px; text-align:center;color:#fff; text-decoration:none;font-weight:bold;border:0; cursor:pointer}
.refund_btn a.blue{ background-position:-102px 0}
.refund_btn .ask_customer_link{background:none;color:#285BCC;width:120px;}
.refund_btn span{color:#285BCC;width:120px;}
.refund_message textarea{vertical-align:middle;width:916px; height:40px; background:#fff}
.refund_fee_detail{border:1px #ddd solid;width:400px;}
.refund_fee_detail h3{font-size:12px; background:#f1f1f1;padding-left:5px;color:#444;}
.refund_fee_detail li{padding-left:5px;}
.refund_fee_detail li.first{border-bottom:1px #ddd solid;}
</style>
<script>
$(function(){
	$('#refund_form').submit(function(){
		if($('textarea[name="content"]').val()==''){
			alert(lang.message_cannot_empty);
			return false;
		}
	});
});
</script>
<div class="content">
    {include file=member.menu.html}
    <div id="right">
        {include file=member.curlocal.html}
        {include file=member.submenu.html}
        <div class="wrap">
            <div class="public refund_form">
            	<ul class="refund_info">
                	<li>{$lang.refund_number}：{$refund.refund_sn}</li>
                    <li>{$lang.apply_date}：{$refund.created|date:Y-m-d H:i:s}</li>
                    <li>{$lang.refund_status}：{if $refund.status=='CLOSED'}{$lang.refund_colse}
                        {elseif $refund.status=='SUCCESS'}{$lang.refund_succed}
                        {elseif $refund.status=='FAILED'}{$lang.refund_fail}
                        {elseif $refund.status=='WAIT_SELLER_AGREE'}{$lang.buyer_apply_refund}
                        {elseif $refund.status=='SELLER_REFUSE_BUYER'}{$lang.seller_refused_refund}
                        {elseif $refund.status=='WAIT_ADMIN_AGREE'}{$lang.seller_agree_refund}
                        {elseif $refund.status=='WAIT_SELLER_CONFIRM'}{$lang.refund_apply_wait}
                        {/if}	
                    </li>
                    <li>{$lang.goods_amount}：{$refund.total_fee|price} <span class="gray">({$lang.cost_of_carriage})</span></li>
                    <div class="refund_fee_detail">
                    	<h3>{$lang.goods_refund_amount} {$refund.refund_fee|price}</h3>
                    	<p>
                        	<li class="first">{$lang.refund_money}：{$refund.refund_goods_fee|price} <span class="gray">({$lang.goods_amount}：{$refund.goods_fee|price})</span></li>
                    		<li>{$lang.refund_delivery_free}：{$refund.refund_shipping_fee|price} <span class="gray">({$lang.delivery_cost}：{$refund.shipping_fee|price})</span></li>
                        </p>
                   	</div>
                    <li>{$lang.receive_cond}：{$refund.refund_shipped}</li>
                    <li>{$lang.refund_reason}：{$refund.refund_reason}</li>
                    <li>{$lang.refund_instruction}：{$refund.refund_desc}</li>
                </ul>
                <div class="refund_btn">
                 	<!--{if $refund.status neq 'SUCCESS' && $refund.status neq 'CLOSED' &&$refund.status neq 'FAILED' && $refund.status neq 'WAIT_ADMIN_AGREE'}-->
                	<!--{if $refund.buyer_id==$visitor.user_id}-->
                    <a href="{url app=refund&act=cancel&refund_id=$refund.refund_id}" onclick="return confirm('{$lang.cancel_confirm}')">{$lang.cancel_refund}</a>
                    <a href="{url app=refund&act=edit&refund_id=$refund.refund_id}" class="blue">{$lang.modify_refund}</a>
                    <!--{else}-->
                	<a href="{url app=refund&act=agree&refund_id=$refund.refund_id}" class="blue" onclick="return confirm('{$lang.agree_refund_info}')">{$lang.agree_refund}</a>
                    <a href="{url app=refund&act=refuse&refund_id=$refund.refund_id}">{$lang.refused_refund}</a>
                    <!--{/if}-->
                    <!--{if $refund.ask_customer!=1}-->
                    <a class="ask_customer_link" onclick="return confirm('{$lang.customer_confirm}');" href="{url app=refund&act=ask_customer&refund_id=$refund.refund_id}">{$lang.customer_invol}</a>
                    <!--{else}-->
                    <span>{$lang.customer_has_deal}</span>
                    <!--{/if}-->
                    <!--{/if}-->
                </div>
                <div class="refund_message">
                	<!--{if $refund.status neq 'SUCCESS' && $refund.status neq 'CLOSED'}-->
                	<form method="post" enctype="multipart/form-data" id="refund_form">
                	<ul class="message_form clearfix">
                    	<li><textarea name="content" class="text"></textarea></li>
                        <li class="float-left mt10">{$lang.upload_document}：<input type="file" name="refund_cert" /></li>
                        <li class="float-right mt10"><input type="submit" name=""  value="{$lang.submit}" class="refund_message_btn"/></li>
                    </ul>
                    </form>
                    <!--{/if}-->
                	<div class="message_list">
                    	<!--{foreach from=$refund.message item=message name=fe_message}-->
                    	<div class="title clearfix">
                        	<h3>
                            {if $message.owner_id==$visitor.user_id}
                            {$lang.self}
                            {elseif $message.owner_role eq 'buyer'}
                            {$lang.buyer}
                            {elseif $message.owner_role eq 'seller'}
                            {$lang.seller}
                            {elseif $message.owner_role eq 'admin'}
                            {$lang.merchant_service}
                            {/if}
                            </h3>
                            <span>{$message.created|date:Y-m-d H:i:s}</span>
                        </div>
                        <div class="content" {if $smarty.foreach.fe_message.last} style="border-bottom:1px #ddd solid"{/if}>
                        	{$message.content}
                            <!--{if $message.pic_url}-->
                            <p style="margin-top:10px;"><img src="{$message.pic_url}" width="200" /></p>
                            <!--{/if}-->
                        </div>      
                        <!--{/foreach}-->              
                    </div>
                    <div class="page-bottom clearfix">
                        {include file=member.page.bottom.html}
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>
{include file=footer.html}
